# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=pcc
pkgver=20230603
pkgrel=0
pkgdesc="The portable C compiler."
url="http://pcc.ludd.ltu.se/"
arch="x86 x86_64"
license="BSD"
depends="pcc-libs-dev~=$pkgver"
makedepends="byacc flex"
subpackages="$pkgname-doc"
source="http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-$pkgver.tgz"

prepare() {
	default_prepare
	update_config_sub

	sed -i -e 's/AC_CHECK_PROG(strip,strip,yes,no)//' \
		configure.ac
	sed -i -e 's/AC_SUBST(strip)//' \
		configure.ac
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-stripping
	make
}

package() {
	make DESTDIR="$pkgdir" install

	# Don't conflict with gcc-doc.
	mv "$pkgdir"/usr/share/man/man1/cpp.1 \
		"$pkgdir"/usr/share/man/man1/$pkgname-cpp.1
}

sha512sums="
249b4c5d369091ec99f2091add2df710d4535d80c42b32c226e55a8ee2c7913233e942960a2298fe1a1ebb25641113e1a0df026b3621dc9d3c6a22fd3bb75055  pcc-20230603.tgz
"
